<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <el-button @click="clickBtn">切换语言</el-button>
    <h3>{{ $t('obj.xxx') }}</h3>
    <!-- <el-button @click="btn">切换全屏</el-button> -->
    <HmNum v-model="funum" />
    <!-- <el-calendar v-model="value" /> -->
    <calendar :value.sync="fatherValue" />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import cookieJs from 'js-cookie'
import calendar from './components/calendar.vue'
// import rili from '@/components/lib/rili.vue'
export default {
  name: 'Dashboard',
  // components: { rili },
  components: { calendar },
  data() {
    return {
      funum: 5,
      // value: new Date()
      fatherValue: new Date()
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods: {
    clickBtn() {
      const langArr = ['zh', 'en']
      // 数组取反
      const _index = langArr.indexOf(this.$i18n.locale)
      this.$i18n.locale = langArr[1 - _index]
      cookieJs.set('lang', langArr[1 - _index])
      this.$router.go(0)
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
